package personresources.manager.jsfTag;

import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.webapp.UIComponentELTag;

import personresources.manager.component.UICalendar;



/**
 * UICalendar tag
 * @author Duy Chuong
 *
 */
public class UICalendarTag  extends UIComponentELTag{
	private static final String COMPENENT_TYPE = "UICalendar";
	private ValueExpression value;
	private MethodExpression action;
	@Override
	public String getComponentType() {
		return COMPENENT_TYPE;
	}

	@Override
	public String getRendererType() {
		// TODO Auto-generated method stub
		return null;
	}

	
	@Override
	public void release() {
		// TODO Auto-generated method stub
		super.release();
		value = null;
		action = null;
	}

	@Override
	protected void setProperties(UIComponent component) {
		// TODO Auto-generated method stub
		super.setProperties(component);
		UICalendar calendar = (UICalendar) component;
		if (value != null) {
			calendar.setValueExpression("value", value);
		}
		if (action != null) {
			calendar.setActionExpression(action);
		}
	}

	public ValueExpression getValue() {
		return value;
	}

	public void setValue(ValueExpression value) {
		this.value = value;
	}

	public MethodExpression getAction() {
		return action;
	}

	public void setAction(MethodExpression action) {
		this.action = action;
	}

}
